package com.file.system.entity.system;


import com.file.system.entity.basic.WebBasic;
import com.file.system.plugin.dict.Dict;
import com.file.system.plugin.validated.SQLInjectionValidation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.groups.Default;
import java.io.Serializable;


/**
 * 过滤词汇
 *
 * @author jch
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class WebFilterWord extends WebBasic implements Serializable {

    private static final long serialVersionUID = 1L;


    //新增
    public interface add extends Default {
    }

    //修改
    public interface update extends Default {
    }

    /**
     * id
     */
    @NotNull(groups = {update.class}, message = "id不能为空")
    @Min(value = 1, message = "id长度最小1")
    private Long id;
    /**
     * 过滤字段
     */
    @NotEmpty(groups = {update.class, add.class}, message = "过滤字段名称不能为空")
    @Size(min = 1, max = 100, message = "过滤字段名长度1-100")
    @SQLInjectionValidation(fieldName = "过滤字段名", enableValidation = false)
    private String filterName;
    /**
     * 字典  启用禁用（字典）
     */
    @NotEmpty(groups = {update.class, add.class}, message = "字典  启用禁用不能为空")
    @Size(min = 1, max = 30, message = "字典  启用禁用长度1-30")
    @Dict("onOff")
    @SQLInjectionValidation(fieldName = "启用禁用")
    private String dictOnOff;
}
